<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-type" content="text/html;charset=utf-8">
  <meta name="MobileOptimized" content="width">
  <meta name="HandheldFriendly" content="true">
  <meta name="viewport" content="width=device-width">
  {{#sprockets_stylesheet_tag}}app{{/sprockets_stylesheet_tag}}
  {{#sprockets_stylesheet_tag}}print print{{/sprockets_stylesheet_tag}}


  {{#css}}<link rel="stylesheet" type="text/css" href="{{custom_css}}" media="all">{{/css}}
  {{#noindex}}<meta name="robots" content="noindex, nofollow" />{{/noindex}}

  <script>
  var criticMarkup = '{{critic_markup}}';
	var baseUrl = '{{base_url}}';
  var showLocalTime = {{{show_local_time}}};
	var uploadDest = 'uploads';
	var perPageUploads = '{{per_page_uploads}}';
	if (perPageUploads == 'true') {
	  uploadDest = uploadDest + window.location.pathname.replace(/.*gollum\/[-\w]+\//, "/").replace(/\.[^/.]+$/, "").replace(baseUrl, "")
	}
	{{#page}}
	  var pageFullPath = '{{escaped_url_path}}';
    var pageFormat   = '{{format}}';
	{{/page}}
  {{#has_search_terms}}
    var searchTerms  = [{{#search_terms}}'{{.}}', {{/search_terms}}
    ];
  {{/has_search_terms}}
  {{#is_create_page}}
    var default_markup = '{{default_markup}}';
  {{/is_create_page}}
  {{#has_editor}}
     var default_keybinding = '{{default_keybinding}}';
  {{/has_editor}}

  </script>
  {{#sprockets_javascript_tag}}app{{/sprockets_javascript_tag}}
  {{#has_editor}}
  {{#sprockets_javascript_tag}}editor{{/sprockets_javascript_tag}}
  {{/has_editor}}

  {{#katex}}
  {{#sprockets_stylesheet_tag}}katex/dist/katex{{/sprockets_stylesheet_tag}}
  <script defer src="{{#sprockets_asset_path}}gollum.katex.js{{/sprockets_asset_path}}"></script>
  <script type="text/javascript">
    var katex_conf = {
      delimiters: [
          {left: '$$', right: '$$', display: true},
          {left: '$', right: '$', display: false},
          {left: '\\(', right: '\\)', display: false},
          {left: '\\[', right: '\\]', display: true}
      ],
      throwOnError : false
    };
  </script>
  {{/katex}}

  {{#mathjax}}
  <script type="text/javascript">
    window.MathJax = {
      tex: {
        inlineMath: [ ['$','$'], ['\\(','\\)'] ],
        displayMath: [ ['$$','$$'], ['\\[','\\]'] ],
        processEscapes: true,
        autoload: {
          color: [],
          colorv2: ['color']
        },
        packages: {'[+]': ['noerrors']}
      },
      options: {
        ignoreHtmlClass: 'tex2jax_ignore',
        processHtmlClass: 'tex2jax_process',
        safeOptions: {
          allow: {
            //
            //  Values can be "all", "safe", or "none"
            //
            URLs:    'safe',
            classes: 'none',
            cssIDs:  'none',
            styles:  'none',
          },
        },
      },
      loader: {
        load: ['[tex]/noerrors', 'ui/safe']
      },
  };
  </script>
  {{/mathjax}}
  
  {{#mermaid}}
  <script>
  var mermaid_conf = {
    startOnLoad: true,
    securityLevel: 'sandbox'
  };
  </script>
  {{/mermaid}}
  
  {{#js}}
  <script type="text/javascript" src="{{custom_js}}"></script>
  {{/js}}
  {{#math_config}}
  <script type="text/javascript" src="{{math_config}}"></script>
  {{/math_config}}

  {{#mathjax}}
  <script async src="{{mathjax_js}}"></script>
  {{/mathjax}}
  {{#katex}}
  <script type="text/javascript">
      document.addEventListener("DOMContentLoaded", function() {
          var page_content_div = document.getElementById('wiki-content');
          if (page_content_div){
            renderMathInElement(page_content_div, katex_conf);
          }
      });
  </script>
  {{/katex}}

  {{#mermaid}}
  {{#sprockets_javascript_tag}}gollum.mermaid.js{{/sprockets_javascript_tag}}
  <script>
    mermaid.initialize(mermaid_conf);
  </script>
  {{/mermaid}}
  
  <title>{{title}}</title>
</head>
<body>
<div class="container-lg clearfix">
{{{yield}}}
</div>
</body>
</html>
